package com.bwda.dsrs.systemservice.api;

import com.bwda.dsrs.systemservice.domain.exception.SystemServiceException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 日志服务调用API
 *
 * @author yanyuemei
 * @date 2019/4/26
 * <p>
 * (FeignClient注解，名称是dsrs-systemService，和application.properties里面的name对应,就可以找到我们的systemService服务)
 */
@FeignClient(name = "logservice", fallback = LogServiceApiFallback.class, configuration = FeginInterceptor.class)
public interface LogServiceApi {

    /**
     * 日志处理缓存模式
     *
     * @param logTemplate
     * @return
     * @throws SystemServiceException
     */
    @PostMapping(value = "/handleLogForCache")
    @Async
    public void handleLogForCache(LogTemplate logTemplate) throws SystemServiceException;

    /**
     * 测试
     *
     * @param id
     * @return
     */
    @PostMapping(value = "/testHello")
    public String testHello(@RequestParam(value = "id") Integer id);

}
